----------------------------------
--      Module Declaration      --
----------------------------------

local boss = BB["Anomalus"]
local mod = BigWigs:New(boss, tonumber(("$Revision: 543 $"):sub(12, -3)))
if not mod then return end
mod.partyContent = true
mod.otherMenu = "Coldarra"
mod.zonename = BZ["The Nexus"]
mod.enabletrigger = {boss} 
mod.guid = 26763
mod.toggleoptions = {"rift", "bosskill"}

--------------------------------
--        Localization        --
--------------------------------

local L = AceLibrary("AceLocale-2.2"):new("BigWigs"..boss)

L:RegisterTranslations("enUS", function() return {
	cmd = "Anomalus",
	rift = "Rift",
	rift_desc = "Warn when Anomalus summons a rift.",
	rift_message = "Rift Summoned",
}

end )

L:RegisterTranslations("deDE", function() return {
	cmd = "Anomalus",
	rift = "Riss",
	rift_desc = "Warnen, wenn Anomalus einen Riss beschwört.",
	rift_message = "Riss beschworen!",
}

end )

L:RegisterTranslations("esES", function() return {
}

end )

L:RegisterTranslations("esMX", function() return {
}

end )

L:RegisterTranslations("frFR", function() return {
	cmd = "Anomalus",
	rift = "Faille",
	rift_desc = "Prévient quand Anomalus invoque une faille.",
	rift_message = "Faille invoquée",
}

end )

L:RegisterTranslations("koKR", function() return {
	cmd = "아노말루스",
	rift = "균열",
	rift_desc = "아노말루스의 균열 소환을 알립니다.",
	rift_message = "균열 소환!",
}

end )

L:RegisterTranslations("ruRU", function() return {
	cmd = "Аномалус",
	rift = "Разломы",
	rift_desc = "Предупреждать, когда Аномалус разрывает пространство, создавая хаотический разлом.",
	rift_message = "Разлом открыт!\"",
}

end )

L:RegisterTranslations("zhCN", function() return {
	rift = "制造裂隙",
	rift_desc = "当阿诺玛鲁斯召唤裂隙时发出警报。",
	rift_message = "召唤裂隙！",
}

end )

L:RegisterTranslations("zhTW", function() return {
	cmd = "艾諾瑪路斯",
	rift = "製造裂縫",
	rift_desc = "當艾諾瑪路斯召喚裂縫時發出警報。",
	rift_message = "召喚裂縫！",
}

end )

----------------------------------
--        Initialization        --
----------------------------------

function mod:OnEnable()
	self:AddCombatListener("SPELL_CAST_SUCCESS", "Rift", 47743)
	self:AddCombatListener("UNIT_DIED", "BossDeath")
end

----------------------------------
--        Event Handlers        --
----------------------------------

function mod:Rift(_, spellId)
	if self.db.profile.rift then
		self:IfMessage(L["rift_message"], "Important", spellId)
	end
end

